<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="telephone=no" name="format-detection" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"
    />
    <title><%= htmlWebpackPlugin.options.title %></title>

    <!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
    <script>
      // VConsole will be exported to `window.VConsole` by default.
      var vConsole = new window.VConsole();
    </script> -->

    <script src="./cordova.js"></script>
  </head>
  <body>
    <script>
      (function () {
        function resize() {
          var ua = window.navigator.userAgent;
          var isAndroid = /(?:Android)/.test(ua),
            isFireFox = /(?:Firefox)/.test(ua),
            isChrome = /(?:Chrome|CriOS)/.test(ua);
          var isTablet =
            /(?:iPad|PlayBook)/.test(ua) ||
            (isAndroid && !/(?:Mobile)/.test(ua)) ||
            (isFireFox && /(?:Tablet)/.test(ua));

          var deviceWidth = document.documentElement.clientWidth;
          var deviceHeight = document.documentElement.clientHeight;

          console.log("deviceWidth---------------", deviceWidth);
          // 横屏下使用高度做恒量长度
          var isLandscape = deviceWidth > deviceHeight;
          var useLength = isLandscape ? deviceHeight : deviceWidth;

          if (isTablet) {
            document.documentElement.style.fontSize = useLength / 18 + "px";
          } else {
            document.documentElement.style.fontSize = useLength / 10 + "px";
          }
        }
        resize();
        window.onresize = resize;
      })();
    </script>
    <div id="app"></div>
  </body>
</html>
